#!/usr/bin/env python
#
# Copyright (C) 2009 Lemur Consulting Ltd
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Setup script for xappy extension module.

"""

import sys

import distutils
from distutils.core import setup, Extension
from distutils import sysconfig

# Customise compiler options.
distutils_customize_compiler = sysconfig.customize_compiler
def my_customize_compiler(compiler):
    """Remove the -Wstrict-prototypes option from the compiler command.

    This option isn't supported for C++, so we remove it to avoid annoying
    warnings.

    """
    retval = distutils_customize_compiler(compiler)
    try:
        compiler.compiler_so.remove('-Wstrict-prototypes')
    except (AttributeError, ValueError):
        pass
    return retval
sysconfig.customize_compiler = my_customize_compiler

long_description = """
The "xappy" python module is an easy-to-use interface to the Xapian search
engine. Xapian provides a low level interface, dealing with terms and
documents, but not really worrying about where terms come from, or how to build
searches to match the way in which data has been indexed. In contrast, "xappy"
allows you to design a field structure, specifying what kind of information is
held in particular fields, and then uses this field structure to index data
appropriately, and to build and perform searches.

Xappy is not yet stable - in particular, both the API and database format will
change in future releases.   If you wish to use it, we recommend that you
subscribe to the xappy-discuss mailing list (see
http://groups.google.com/group/xappy-discuss) to keep up-to-date with changes
to Xappy.

"""


setup(name = "xappy2",
      version = "0.9.0", # update this in src/xappy2/core/__init__.py, too.  FIXME - get automatically
      author = "Richard Boulton",
      author_email = "richard@tartarus.org",
      maintainer = "Richard Boulton",
      maintainer_email = "richard@tartarus.org",
      url = "http://xappy.org/",
      download_url = "http://xappy.googlecode.com/files/xappy2-0.9.0.tar.gz",
      description = "Easy-to-use interface to the Xapian search engine",
      long_description = long_description,
      classifiers = [
          'Development Status :: 3 - Alpha',
          'Intended Audience :: Developers',
          'License :: OSI Approved :: GNU General Public License (GPL)',
          'Programming Language :: C++',
          'Topic :: Internet :: WWW/HTTP :: Indexing/Search',
          'Operating System :: MacOS',
          'Operating System :: Microsoft',
          'Operating System :: POSIX',
      ],
      license = 'MIT',
      platforms = 'Any',

      packages = [
          'xappy2',
          'xappy2.client',
          'xappy2.core',
          'xappy2.server',
          'xappy2.server.backends',
          'xappy2.server.wsgiwapi.cpwsgiserver',
          'xappy2.server.wsgiwapi',
      ],
      package_dir = {'': 'src'},
      scripts = [
          'src/bin/xappyserver',
      ]
)
